<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">

<head th:replace="/common/header::header(~{::title})">
<title>用户信息</title>
</head>

<body>

	<div class="sui-main">
		<ul class="sui-breadcrumb">
			<li class="active">用户信息</li>
		</ul>
		<!-- 搜索 -->
		<form method="get" th:action="@{/bs/test01/userInfo/list}" class="sui-form form-horizontal submit_form">
			<div class="sui-row-fluid sui-row-fluid-search">

				<div class="span4">
					<div class="control-group">
						<label class="control-label">用户编号：</label>
						<div class="controls">
							<input autocomplete="off" type="text" placeholder="请输入用户编号" name="userId" th:value="${userId}" class="input-large input-fat">
						</div>
					</div>
				</div>
			</div>
			<div class="control-group submit_btn">
				<div class="controls">
					<button class="sui-btn btn-bordered btn-large btn-primary" type="submit">
						<i class="sui-icon icon-tb-search"></i>搜索
					</button>
				</div>
			</div>
		</form>

		<!-- 上分页 -->
		<form class="sui-pager" method="get" th:action="@{/bs/test01/userInfo/list}" name="frmTurnPage1">

			<input type="hidden" name="userId" th:value="${userId}" />
			<div class="clearfix" th:include="common/turnPage::pager('frmTurnPage1')"></div>
		</form>


		<!-- 列表 -->
		<form id="J_delForm" th:action="@{/bs/test01/userInfo/delRecords}">
			<div class="clearfix" style="margin-bottom: 10px;">
				<div class="pull-left">
					<button class="sui-btn btn-bordered btn-default" type="button" onclick="Util.confirmSelectedCheckboxes('J_delForm', 'checkAll');">
						<i class="sui-icon icon-tb-delete"></i>删除
					</button>
					<button class="sui-btn btn-bordered btn-primary" type="button" data-toggle="modal" data-target="#suiModal"
						onclick="g_needReloadPage = true;$('#J_modalLabel').text('新增');$('#J_modalIframe').attr('src', 'showAdd');">
						<i class="sui-icon icon-tb-add"></i>新增
					</button>
				</div>
				<div class="pull-right">
					<button class="sui-btn btn-bordered btn-default" type="button" onclick="document.getElementById('J_exportForm').submit();">
						<i class="sui-icon icon-tb-pulldown"></i>导出csv
					</button>
				</div>
			</div>

			<table class="sui-table table-bordered table-zebra">
				<thead class="records_table_head">
					<th width="55"><label data-toggle="checkbox" class="checkbox-pretty inline"> <input id="checkAll" type="checkbox"
							onclick="if(this.checked) {Util.selectAllCheckbox(this.form);} else { Util.cancelAllCheckbox(this.form); }"><span>全选</span>
					</label></th>
					<th>用户编号</th>
					<th>用户名</th>
					<th>年龄</th>
					<th>注册时间</th>
					<th width="80">操作</th>
				</thead>
				<tbody>
					<tr class="records_table_record" th:each="record:${pageData.resultList}">
						<td><label data-toggle="checkbox" class="checkbox-pretty inline"> <input type="checkbox" name="delIds" th:value="${record.userId}"
								onclick="Util.verifyCheckAll(this.form, 'checkAll');"><span>&nbsp;</span>
						</label></td>

						<td th:text="${record.userId}"></td>

						<td th:text="${record.userName}"></td>

						<td th:text="${record.age}"></td>

						<td th:text="${#dates.format(record.registerTime, 'yyyy-MM-dd HH:mm:ss')}"></td>
						<td>
							<div class="btn-group-vertical btn_operators">
								<a href="javascript:void(0)" data-toggle="modal" data-target="#suiModal"
									th:onclick="|javascript:g_needReloadPage = false;$('#J_modalLabel').text('查看');$('#J_modalIframe').attr('src', 'show?userId=${record.userId}');|">查看</a>
								<a href="javascript:void(0)" data-toggle="modal" data-target="#suiModal"
									th:onclick="|javascript:g_needReloadPage = true;$('#J_modalLabel').text('修改');$('#J_modalIframe').attr('src', 'showUpd?userId=${record.userId}');|">修改</a>
								<a href="javascript:void(0)" data-toggle="modal" data-target="#suiModal"
									th:onclick="|javascript:g_needReloadPage = true;$('#J_modalLabel').text('复制新增');$('#J_modalIframe').attr('src', 'showAdd?userId=${record.userId}');|">复制新增</a>
							</div>
						</td>
					</tr>
				</tbody>
			</table>

		</form>

		<!-- 下分页 -->
		<form class="sui-pager" method="get" th:action="@{/bs/test01/userInfo/list}" name="frmTurnPage2">

			<input type="hidden" name="userId" th:value="${userId}" />
			<div class="clearfix" th:include="common/turnPage::pager('frmTurnPage2')"></div>
		</form>

		<!-- 导出 -->
		<form id="J_exportForm" method="post" th:action="@{/bs/test01/userInfo/export}">

			<input type="hidden" name="userId" th:value="${userId}" />
		</form>
		<!-- 通用弹出层 -->
		<div id="suiModal" tabindex="-1" role="dialog" data-hasfoot="false" data-width="normal" class="sui-modal hide fade">
			<div class="modal-dialog">
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" data-dismiss="modal" aria-hidden="true" class="sui-close">×</button>
						<h4 id="J_modalLabel" class="modal-title">标题</h4>
					</div>
					<div class="modal-body">
						<iframe class="sui-iframe" id="J_modalIframe" src="" width="100%" height="100%"></iframe>
					</div>
				</div>
			</div>
		</div>

	</div>

	<script>
		$('#suiModal').on('hidden', function() {
			if (g_needReloadPage) {
				location.reload();
			}
		}).on('shown', function() {
			$('#J_modalIframe').autoheight();
		});
	</script>

</body>
</html>
